package com.CST.controller;


import com.CST.annotation.*;
import com.CST.common.constant.*;
import com.CST.entity.*;
import com.CST.service.*;
import io.swagger.annotations.*;
import java.util.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;

/**
* @author ly
* @since 2023-04-11
*/
@Api(tags = {"新表，二级明细"})
@RestController
@RequestMapping("/baseSecondSubS")

    public class BaseSecondSubSController {

    @Autowired
    private IBaseSecondSubSService targetService;


    @PostMapping("/saveOrUpdate")
    @ApiOperation("新建或编辑")
    @ResultObjectAnnotation(value=DmlTypeConstant.INSERT,successMessage = "新建或编辑成功!",errorMessage = "新建或编辑失败!")
    public Object saveOrUpdate(@RequestBody BaseSecondSubS BaseSecondSubS) {
    return targetService.saveOrUpdate( BaseSecondSubS);
    }


    @GetMapping("/getById/{id}")
    @ApiOperation("查看")
    @ResultObjectAnnotation(DmlTypeConstant.SELECT)
    public Object getById(@PathVariable String id) {
    return targetService.getById(id);
    }


    @DeleteMapping("/delete/{ids}")
    @ApiOperation("删除")
    @ResultObjectAnnotation(DmlTypeConstant.DELETE)
    public Object delete(@PathVariable List
    <String> ids) {
      return targetService.removeByIds(ids);
      }



}

